<?php

class konsultanTable extends Doctrine_Table
{
    public function getActiveUserKonsultan($id_user) {
        $q = $this->createQuery('k')
                ->where('id_user = ?', $id_user);

        return $q->execute();
    }

    public function getKonsultanList() {
        $q = Doctrine_Query::create()
                ->select('k.id as id, u.nama as nama')
                ->from('konsultan k')
                ->leftJoin('k.user u');

        $q = $q->execute();

        $result = array();
        foreach($q as $r) {
            $result[$r->getId()] = $r->getNama();
        }

        return $result;
    }
}